package com.bball.court.controller.google;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.bball.court.FaCConfiguration;
import com.bball.court.controller.CourtController4Test;
import com.bball.court.http.AddCourtRequestCallbacks;
import com.bball.court.http.DeleteCourtRequest;
import com.bball.court.http.DeleteCourtRequestCallbacks;
import com.bball.court.http.GetClosestCourtRequest;
import com.bball.court.http.GetClosestCourtRequest4Test;
import com.bball.court.http.GetCourtsRequestCallbacks;
import com.bball.court.http.PostCourtRequest;
import com.bball.court.http.PostCourtRequest4Test;
import com.bball.court.model.Court;
import com.bball.court.model.google.GoogleCourtList;

public class GoogleCourtController4Test extends GoogleCourtController implements CourtController4Test {

    public GoogleCourtController4Test(Context context) {
        super(context);
    }

    @Override
    public void deleteCourt(String courtId, DeleteCourtRequestCallbacks callbacks) {
        String url = FaCConfiguration.getInstance(context).getGoogleDeleteCourtUrl(courtId);
        getRequestQueue().add(new DeleteCourtRequest(context, url, getClass().getSimpleName(), callbacks));
    }
    
    @Override
    protected PostCourtRequest getPostCourtRequest(AddCourtRequestCallbacks callbacks, Court court, String url) {
        return new PostCourtRequest4Test(context, court, url, getClass().getSimpleName(), callbacks);
    }
    
    @Override
    protected RequestQueue getRequestQueue() {
        return Volley.newRequestQueue(context);
    }
    
    protected GetClosestCourtRequest<GoogleCourtList> getClosestCourtRequest(GetCourtsRequestCallbacks callbacks, String url) {
        return new GetClosestCourtRequest4Test(context, url, GoogleCourtList.class, getClass().getSimpleName(), callbacks);
    }
}
